import React from 'react';
import './App.css';
// import GitHubUser from './components/GitHubUser';
// import Goods from './components/Goods';
// import Joke from './components/Joke';
// import YiYan from './components/YiYan';
// import RouteDemo from './components/RouteDemo';
//导入 路由组件
import {Route, Link, Switch, withRouter} from 'react-router-dom';
import Hero from './pages/Hero';
import DouYin from './pages/DouYin';
import HeroDetail from './pages/HeroDetail';
import DouYinDetail from './pages/DouYinDetail';

class App extends React.Component {
    render(){
        return <div>
            {/* <Link to="/hero">英雄</Link> */}
            {/* <button onClick={this.jump} className="btn btn-default">英雄</button> */}

            <Switch>
                <Route exact path="/douyin" component={DouYin}  />
                <Route exact path="/douyin/:id" component={DouYinDetail}  />

                <Route path="/hero" component={Hero} />
                <Route path="/hero-detail/:id" component={HeroDetail} />
            </Switch>
        </div>;
    }

    jump = () => {
        this.props.history.push('/hero');    
    }
}

export default withRouter(App);